package com.oig.sys.workflow;


import com.oig.sys.workflow.api.AuditCallService;
import com.oig.sys.workflow.event.AuditCallEventListener;
import lombok.RequiredArgsConstructor;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableAsync;

@EnableAsync
@RequiredArgsConstructor
@ConditionalOnWebApplication
@Configuration
public class EventAutoConfiguration {

    private final AuditCallService auditCallService;


    @Bean
    public AuditCallEventListener auditCallEventListener() {
        return new AuditCallEventListener(auditCallService);
    }


}
